package com.waijiaojun.tpo.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.waijiaojun.tpo.entity.Scenario;
import org.springframework.web.multipart.MultipartFile;

/**
 * Created by Peter on 2018/2/27.
 */
public class ArticleModel {
    private Long id;//                   bigint not null auto_increment,
    private String tpo_name;//        varchar(512),
    private Long categoryId;//           bigint,
    private Long order;//              varchar(512),
    private String nameCn;//               varchar(512),
    private String nameEn;//               varchar(512),
    private String articleEn;//            text,
    private String articleCn;//            text,
    private String audioUrl;//             varchar(512),
    private String coverUrl;//             varchar(512),
    @JsonIgnore
    private MultipartFile audioFile;
    @JsonIgnore
    private MultipartFile coverFile;

    public MultipartFile getAudioFile() {
        return audioFile;
    }

    public void setAudioFile(MultipartFile audioFile) {
        this.audioFile = audioFile;
    }

    public MultipartFile getCoverFile() {
        return coverFile;
    }

    public void setCoverFile(MultipartFile coverFile) {
        this.coverFile = coverFile;
    }

    public String getTpo_name() {
        return tpo_name;
    }

    public void setTpo_name(String tpo_name) {
        this.tpo_name = tpo_name;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

    public Long getOrder() {
        return order;
    }

    public void setOrder(Long order) {
        this.order = order;
    }

    public String getNameCn() {
        return nameCn;
    }

    public void setNameCn(String nameCn) {
        this.nameCn = nameCn;
    }

    public String getNameEn() {
        return nameEn;
    }

    public void setNameEn(String nameEn) {
        this.nameEn = nameEn;
    }

    public String getArticleEn() {
        return articleEn;
    }

    public void setArticleEn(String articleEn) {
        this.articleEn = articleEn;
    }

    public String getArticleCn() {
        return articleCn;
    }

    public void setArticleCn(String articleCn) {
        this.articleCn = articleCn;
    }

    public String getAudioUrl() {
        return audioUrl;
    }

    public void setAudioUrl(String audioUrl) {
        this.audioUrl = audioUrl;
    }

    public String getCoverUrl() {
        return coverUrl;
    }

    public void setCoverUrl(String coverUrl) {
        this.coverUrl = coverUrl;
    }

    public Scenario toEntity() {
        Scenario scenario = new Scenario();
        scenario.setId(this.id);
        scenario.setCategoryId(this.categoryId);
        scenario.setCoverUrl(this.coverUrl);
        scenario.setTpo_name(this.tpo_name);
        scenario.setArticleCn(this.articleCn);
        scenario.setArticleEn(this.articleEn);
        scenario.setNameEn(this.nameEn);
        scenario.setNameCn(this.nameCn);
        scenario.setOrder(this.order);
        return scenario;
    }
}

